print("实在是")


def print_file_info(file_name):
    f = open(file_name, 'r')
    try:
        print(f.read())
    except Exception as e:
        print(e)
    finally:
        f.close()


def append_to_file(file_name, data):
    with open(file_name, 'a') as f:
        f.write(data)
    with open(file_name, 'r') as f:
        print(f.read())


if __name__ == '__main__':
    print_file_info(r"D:\python\pythoncode\python-goLearn\07_python_file\bill.txt")
    append_to_file(r"D:\python\pythoncode\python-goLearn\07_python_file\bill.txt", "liagdiw")
